home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung CD 2 (Tewi)(1994).iso
/
doc
/
labels
/
labels.doc
< prev
Wrap
Text File
|
1991-10-03
|
3KB
|
93 lines
Language Tip
The Problem:
Closing up blank lines when printing a label report.
For example, let's say your record structure includes the standard
Name, Company, Address, City, State, and Zipcode. If you create a
6-line label report that looks like this:
------------------------------
Name
Company
Address
City, State Zipcode
------------------------------
and the Company field is empty, your label will print with a blank
line where the Company should be, that is:
------------------------------
Name
Address
City, State Zipcode
------------------------------
The Solution:
It is a simple matter to eliminate blank lines from labels when
printing records that may have an empty field. You can correct this
problem is two simple steps. First, using Editor, we will create
a second report Detail structure. Second, we will place an IF/THEN
structure within the main procedure loop to test for a blank
Company field. Lastly, if you have created any computed fields to
concatenate consecutive fields, there is one simple, final adjust-
ment to make.
First Step
Bring up your report procedure in Editor (see figure 1). Make a
duplicate of the Detail structure just below the original, using
the copy (CTRL-C) command (see figure 2). Using the report
formatter, remove the (Company) line from the second Detail
structure, and place an extra blank line at the bottom to maintain
6 lines per label (see figure 2a). Append a "1" to the end of
Detail and any computed field labels in the first structure, and a
"2" to the same in the second structure (see figure 3).
Second Step
Replace the "PRINT(RPT:DETAIL)" statement in your report (see
figure 4) with an IF/THEN structure (see figure 5). Specify that
if the variable in question, in our case, Company, is a null, then
Detail #2, which closes up the Company line and adds an extra line
for spacing at the bottom, should be used. Otherwise, use the
original Detail #1, which will print the Company line.
Adjusting for Computed Fields
In our example, you would want to clip any trailing spaces from the
City field, so the last printed line would always look like this:
City, State Zipcode
and never look like this:
City , State Zipcode.
To do this, you would create a computed field in your report
formatter, which I called CitStaZip, like so:
Clip(PRE:City)&', '&PRE:State&' '&PRE:Zipcode
In the report structure where you have equated your field label to
this formula, you should once again duplicate your equate just
below the original, and append "1" and "2" to the respective
definitions (see figures 6&7).
When you have followed these instructions carefully, your mailing
labels will never again get that "empty feeling".
Contributed by:
James Portanova
HOT PROPERTIES SOFTWARE
Post Office Box 437
Fresh Meadows, New York 11365-0437